#include <OgreVector2.h>
#include <OgreSceneManager.h>
#include <OgreEntity.h>
#include <OgreSceneNode.h>
#include <OgreVector2.h>
#include "Globals.h"

class Poly
{
  public:    
	Poly(Ogre::String name, bool visible, Ogre::Vector2 p1, Ogre::Vector2 p2, Ogre::Vector2 p3, Ogre::Vector2 p4, Ogre::SceneManager *sceneManager); 
	Poly(Ogre::String name, Ogre::Vector2 position, Ogre::Real depth, Ogre::Real rotation, bool visible, int type, std::vector<Ogre::Vector2> polyPoints, Ogre::SceneManager *sceneManager);
    ~Poly();
 
	Ogre::SceneNode* m_polyNode;
	void makeDynamic(bool dynamic);
	void setPosition(Ogre::Vector2 newPosition);
	Ogre::Vector2 getPosition();

	bool getSelected(){return m_selected;};
	void setSelected(bool selected){m_selected = selected;};

	std::vector<Ogre::Vector2> m_polygonPoints;

  private:                           
	void setPolyName(Ogre::String name){m_polyName = name;}
	Ogre::String getPolyName(void){return m_polyName;}
	void drawSelf();

	Ogre::Real m_depth;
	Ogre::Vector2 m_polyCenter;
	Ogre::Real m_rotation;
	Ogre::String m_polyName;
	Ogre::SceneManager *m_sceneManager;
	Ogre::ManualObject* m_polygon;
	int m_polyType;
	bool m_draw;
	bool m_selected;
};
